package 对象的创建;

import java.lang.reflect.Array;
import java.util.ArrayList;

public class Main {
    public static void main(String[] args) {
        ArrayList arrayList = new ArrayList();
        arrayList.add("Java");
        arrayList.add("Java");
        arrayList.add("黑马");
        arrayList.add(10);
        arrayList.add(10.5);
        arrayList.add(true);
        arrayList.add('中');
        System.out.println(arrayList);


        arrayList.add(1,"鸣人");
        System.out.println(arrayList);

        ArrayList<String> strings = new ArrayList<>();

        System.out.println(arrayList.get(1));//  get

        System.out.println(arrayList.size());//  size

        for (int i = 0; i < arrayList.size(); i++) {
            System.out.print(arrayList.get(i)+" ");
        }
        System.out.println();

        String e2 = (String) arrayList.remove(1); // remove
        System.out.println(e2);
        System.out.println(arrayList);

        arrayList.remove("Java");
        System.out.println(arrayList);

        ArrayList<Integer> integers = new ArrayList<>();
        for (int i = 5; i >= 0; i--) {
            integers.add(i);
        }
        integers.remove((Integer) 5);
        System.out.println(integers);

        arrayList.set(1,"C语言");//   set
        System.out.println(arrayList);
    }
}
